home *** CD-ROM | disk | FTP | other *** search
- Path: maui.cc.odu.edu!news
- From: "CLEVELAND O. BURNETT" <cob@cs.odu.edu>
- Newsgroups: comp.lang.c++
- Subject: READING FROM A TEXTFILE
- Date: Fri, 12 Apr 1996 12:33:04 -0400 (EDT)
- Organization: Old Dominion University
- Message-ID: <Pine.SUN.3.90.960412122731.1477A-100000@dew.cs.odu.edu>
- NNTP-Posting-Host: dew.cs.odu.edu
- Mime-Version: 1.0
- Content-Type: TEXT/PLAIN; charset=US-ASCII
-
-
- I have had trouble reading from a textfile. I am trying to read
- a textfile into a C++ struct. This is the struct
-
-
-
-
- #include <iostream.h>
- #include <fstream.h>
-
-
- struct students {
- char firstname[20];
- char middle_initial;
- char lastname[20];
- char address1[40];
- char address2[30];
- char phone_number[7];
- char email[50];
- char dept[16];
- char edu_level[9];
- };
-
-
- The textfile has contains char firstname down to edu_level --- each char
- string is one line in the file.
-
- How can I read this struct from the textfile?
-
-
-
- Help me?
-
- thank you,
- Cleveland Burnett
-